/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2022-2022. All rights reserved.
 */
import { Module, Project } from '../../../index';
import { mockProjectFromResourcesPath } from '../common/init-project';
import { instanceOf } from '../../../../src/base/util/class-identify-util';
import { ClassTypeConst } from '../../../../src/base/common/options/class-type-const';

const project: Project = mockProjectFromResourcesPath('common-test');

describe('test class instance of', () => {
  test('project is project', () => {
    const isProject = instanceOf(project, ClassTypeConst.HVIGOR_PROJECT);
    expect(isProject).toBeTruthy();
    const module: Module = project.findModuleByName('module1') as Module;
    const isModule = instanceOf(module, ClassTypeConst.HVIGOR_MODULE);
    expect(isModule).toBeTruthy();
    const isNotModule = instanceOf(project, ClassTypeConst.HVIGOR_MODULE);
    expect(isNotModule).toBeFalsy();
  });
});
